package com.jzo2o.customer.controller.operation;

import cn.hutool.core.bean.BeanUtil;
import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.model.dto.request.CertificationAuditReqDTO;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationAuditResDTO;
import com.jzo2o.customer.model.dto.response.WorkerCertificationResDTO;
import com.jzo2o.customer.service.IWorkerCertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author itcast
 */
@RestController("WorkerCertificationAuditController")
@RequestMapping("/operation/worker-certification-audit")
@Api(tags = "运营端 - 服务人员审核认证相关接口")
public class WorkerCertificationAuditController {

    @Resource
    private IWorkerCertificationService workerCertificationService;

    /**
     *  审核服务人员认证分页查询
     * @param reqDTO
     * @return
     */
    @GetMapping("/page")
    @ApiOperation("查询审核认证分页信息")
    public PageResult<WorkerCertificationAuditResDTO> getPageWorkAudit(WorkerCertificationAuditPageQueryReqDTO reqDTO) {
        return workerCertificationService.getPageWorkAudit(reqDTO);
    }

    /**
     *  审核服务人员认证信息
     * @param reqDTO
     * @return
     */
    @PutMapping("/audit/{id}")
    @ApiOperation(" 审核服务人员认证信息")
    public Boolean auditWorkerServe(@RequestBody CertificationAuditReqDTO reqDTO,
                                    @PathVariable String id) {
        return workerCertificationService.auditWorkerServe(reqDTO,id);
    }



}
